package week06

// 70. 爬楼梯
// https://leetcode-cn.com/problems/climbing-stairs/

func climbStairs(n int) int {
	var f = make([]int, n+1)
	f[0], f[1] = 1, 1
	// f[i] = f[i-1] + f[i-2]
	for i := 2; i <= n; i++ {
		f[i] = f[i-1] + f[i-2]
	}
	return f[n]
}